package com.ek.common.task;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.ek.service.mina.handler.DispatcherHandler;

public class DeleteListener extends FutureTask<Void> {
    private static final transient Logger log = LoggerFactory.getLogger(DeleteListener.class);

    public DeleteListener(final String key, final DispatcherHandler handler) {
        super(new Callable<Void>() {

            public Void call() throws Exception {
                handler.removeListener(key);
                log.debug("deleted");
                return null;
            }
        });
    }

}
